import Request from '@/api/request'
var request = new Request().http

// ==================================志愿队伍=================================
//获取全部志愿服务站
export function getTeamList(data : any) {
	return request({
		url: "/applet/team/list",
		method: "Post",
		data
	})
}

//查询所有站点列表
export function getTreeInfo() {
	return request({
		url: "/applet/site/treeList",
		method: "Get"
	})
}

// 查询队伍成员
export function getTeamMemberList(data) {
	return request({
		url: "/applet/team/memberList",
		method: "Post",
		data
	})
}
// 加入队伍
export function applyTeam(data) {
	return request({
		url: "/applet/team/takePart",
		method: "Post",
		data
	})
}
//通过名称查询志愿者队伍
export function getTeamInfo(teamName) {
	return request({
		url: "/applet/team/info",
		method: "Get",
		data: {
			teamName
		}
	})
}

//获取对应节点下的地区树选项获取对应节点下的地区树选项
export function getRegion(regionId) {
	return request({
		url: "/applet/region/treeList",
		method: "Get",
		data: {
			regionId
		}
	})
}
// =================================队伍管理==========================
// 获取管理员列表
export function getManageList(data) {
	return request({
		url: "/applet/team/memberList",
		method: "Post",
		data
	})
}
// 删除管理员
export function deleteMember(data) {
	return request({
		url: "/applet/team/member",
		method: "delete",
		data: data.relationId
	})
}
// 查询已加入的队伍
export function joined() {
	return request({
		url: "/applet/user/team/joined",
		method: "Get"
	})
}
// 退出队伍
export function joinedquit(data) {
	return request({
		url: "/applet/user/team/joined/quit",
		method: "delete",
		data: data
	})
}
